﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Threading;

namespace MyClassSocket
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Que sos?");

            Console.WriteLine("A- Server");
            Console.WriteLine("B- Cliente");

            char a = (char)Console.Read();
            switch (a)
            {
                case 'A':
                    //CServidor server = new CServidor(7300);
                    //server.Run();

                    ChatMan_srv server = new ChatMan_srv();
                    server.Run();
                    

                    break;

                case 'B':
                    //CCliente Cliente = new CCliente("192.168.1.34",7300);
                    //Cliente.Run();
                    
                    ChatMan chat = new ChatMan();
                    chat.Iniciar();
                    Thread imprimirSMG = new Thread(new ThreadStart(chat.receivChatear));

                    imprimirSMG.Start();

                    while (true)
                    {
                        chat.sendChatear();
                    }
            }

            Console.ReadKey();
        }

    }
}
